<link href="https://fonts.googleapis.com/css?family=Open+Sans:400,600,700&amp;subset=cyrillic" rel="stylesheet">
<link rel="stylesheet" type="text/css" media="screen" href="../index.css"></script>
 
  <script >
  	  <!-- 时间转换工具 -->
  function timestampToTime(timestamp) {
        var date = new Date(timestamp * 1000);//时间戳为10位需*1000，时间戳为13位的话不需乘1000
        Y = date.getFullYear() + '-';
        M = (date.getMonth()+1 < 10 ? '0'+(date.getMonth()+1) : date.getMonth()+1) + '-';
        D = date.getDate() + ' ';
        h = date.getHours() + ':';
        m = date.getMinutes() + ':';
        s = date.getSeconds();
        return Y+M+D+h+m+s;
    }
    //console.log(timestampToTime(1403058804));
    

</script>

  <div  id="comment" style="margin: -10px 0px 0px 0px;"> 
   <div class="hcc hc__top"> 
    <div class="hcc hc__clear"></div> 
    <div class="hcc hc__menu"> 
     <div rel="hc_tab" data-tab="comment" el="commentTab" class="hcc hc__menu__item hc__menu__comment hc_unclick">
      评论 (
      <span class="hcc hc__menu__count" el="comments_countCount">7675</span>) 
 
     </div>
     <!--div rel="hc_tab" data-tab="quote" el="quoteTab" class="hcc hc__menu__item">
      引述 (
      <span class="hcc hc__menu__count" el="quotesCount">533</span>)
     </div-->
     <div rel="hc_tab" data-tab="context" el="contextTab" class="hcc hc__menu__item hc__hide">
      上下文
     </div>
     <div el="ActiveLine" class="hcc hc__menu__line" style="width: 90px; left: 0px; opacity: 1;"></div>
 
    </div>
    <div class="hcc" el="FormHc">
     <div class="hcc hc__form">
      <div class="hcc hc__reply__photo" el="HCAvatar">
       <img el="Avatar" class="hcc" src="" title="" />
      </div>
      <div class="hcc hc__reply__box">
       <textarea id="commentContent" el="HcText" class="hcc hc__reply__box__textarea" placeholder="输入文字..." active="true" style="height: 137px; overflow: visible;" onpropertychange="this.style.height=this.scrollHeight + 'px'" oninput="this.style.height=this.scrollHeight + 'px'"></textarea> 
       <div class="hcc hc__reply__close" el="CloseForm" style="display: block;"></div>
      </div> 
      <div class="hcc hc__reply__files" el="AttachFiles"></div> 
 
      <div class="hcc hc__reply__buttons" el="FButtons" style="display: block;"> 
       <div class="hc__loader" id="hc_loader">
        <svg class="hc__loader__circular">
         <circle class="hc__loader__path" cx="10" cy="10" r="8" fill="none" stroke-width="2" stroke-miterlimit="5"></circle>
        </svg>
       </div> 
       <div class="hcc hc__form__category hc_unclick" el="Cat"  style="cursor:hand">
        <span id="n1" class="hcc" el="CatTitle"><a  style="cursor: pointer;">点击右侧评论 </a></a></span>
        	<span id="n2" class="hcc" el="CatTitle" style="display:none;"><a  onclick="canceled()" style="cursor: pointer;">正在对用户的留言进行回复(点击撤销✘)</a></a></span>
        <div class="hcc hc__form__category__t"></div> 
        <div class="hcc hc__message__popup" el="CatBox"> 
         <div class="hcc hc__message__popup__item" rel="CatItem" data-id="3189">
         
         </div>
        </div>
       </div> 
       <div id="info" style="display:none">
       	<input type="text" id="link_reply_comment_id" value="">
       	<input type="text" id="link_reply_author_name" value="">
       </div>
       <div id="commentsubmit" class="hcc hc__form__send" el="HcSend">
        发送评论
       </div>
      </div> 
      <div class="hcc hc__clear"></div>
     </div>
    </div>
    <div class="hcc hc__clear"></div> 
    <div class="hcc" el="RtHC"></div>
    <div class="hcc" el="HcContent"> 
     <div class="hcc hc__messages"> 
      
      #foreach($key in $comments.keySet())
      <div id="hcm-1532409341130055" class="hcc hc__m hc__message" itemtype="http://schema.org/Comment" itemscope="itemscope">
       <div el="AvatarWrap" class="hcc hc__avatar">
        <img   src=""  title="Daniel Zen" />
       </div>
       <div class="hcc hc__message__comment" el="Comment">
        <div class="hcc hc__message__header">
    <span el="Nick" data-href="https://profile.hypercomments.com/1" class="hcc hc__nick" itemprop="author">$key.author_name</span>
          
         <span class="hcc hc__time" el="Time"><script>document.write(timestampToTime($key.publish_time));</script></span>
        </div>
        <div class="hcc hc__message__txt" el="Text" itemprop="text">
         $key.content
        </div>
 
        <div el="FooterCom" class="hcc hc__message__footer">
         <div class="hcc hc__manager">
          <div class="hcc hc__manager__item"  author="$key.author_name" highid="$key.comment_id"  numid="$key.comment_id" onclick="aaa(this)">
           <a href="#comment"  style="color: #a3a3a3"  id="hfa"  > 回复</a>
            <!--||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||-->
          </div>
         </div>
         <span class="hcc" el="RTline"></span>
 
         <div class="hcc hc__voting" el="Voting" style="display: none;">
          <div class="hcc hc__voting__good" rel="Vote" data-v="up"></div>
          <div class="hcc hc__voting__bad" rel="Vote" data-v="dn"></div>
         </div>
         <div class="hcc hc__clear"></div>
        </div>
       </div>
       <div class="hcc hc__message__reply" el="ReplyForm"></div> 
    
       
       
 
       #foreach($replylists in $comments.get($key))
       <div id="hcm-1532422469869965" class="hcc hc__m hc__message" itemtype="http://schema.org/Comment" itemscope="itemscope">
        <div el="AvatarWrap" class="hcc hc__avatar">
         <img src="" title="标题" /> 
         <div title="Moderator" class="hcc hc__avatar__m">
          M
         </div>
        </div> 
        <div class="hcc hc__message__comment" el="Comment"> 
         <div class="hcc hc__message__header">
          <span el="Nick" data-href="https://profile.hypercomments.com/1" class="hcc hc__nick" itemprop="author">$replylists.author_name</span><!-- 回复者名称 --> 
          <span class="hcc hc__nick__parent" el="ToMes">&gt; $replylists.link_reply_author_name</span><!-- 被回复者名称 --> 
          <meta itemprop="dateCreated" content="2018-07-24T16:54:29" />
          <span class="hcc hc__time" el="Time"><script>document.write(timestampToTime($replylists.publish_time));</script></span>
         </div> 
         <div class="hcc hc__message__txt" el="Text" itemprop="text">
          $replylists.content

         </div> 
           <div class="hcc hc__manager__item"  author="$replylists.author_name" onclick="aaa(this)" highid="$key.comment_id" numid="$replylists.comment_id"  >
            <a href="#comment"  style="color: #a3a3a3" id="hfb" > 回复</a>
            <!--||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||-->
          </div>
        </div> 
        <div class="hcc hc__message__reply" el="ReplyForm"></div> 
       </div> <br>
      #end 
          
       
      </div>
     #end 
      
       
     </div> 
    </div>
    <div class="hcc" el="More">
     <div class="hcc hc__showmore" el="LoadMore">
      <div class="hc__showmore__item">
       更多
      </div>
     </div>
    </div>
    <div class="hcc hc__footer">
     <a el="Logo" style="visibility: visible !important; opacity: 1 !important; position: initial !important; transform: scale(1) !important; overflow: initial !important; filter: blur(0px) !important; display: block !important;" class="hcc hc__footer__logo" href="http://www.hypercomments.com" rel="nofollow" target="_blank"></a>
     <div class="hcc hc__footer__r">
      <div class="hcc hc__footer__wrapf hc_unclick" el="SubWrap">
       <input class="hcc" el="SubInp" type="text" placeholder="Enter Email" />
       <hr class="hcc hc__footer__wrapf__hrgrey" />
       <hr class="hcc hc__footer__wrapf__hract" />
      </div>
      <div class="hcc hc__footer__rss">
       <a class="hcc" target="_blank" href="http://c1n1.hypercomments.com/rss/40/519b8a272a67d40d7e00042d" el="Rss"></a>
      </div>
     </div>
    </div>
   </div>
   <div class="hcc hc__clear"></div>
  </div>
 <script>

 	  <!-- 提交按钮点击事件 -->
  commentsubmit.onclick=function(){

 	var comment=new Object();//要提交的类每个属性填写
 	comment.content=$('#commentContent').val();
 	comment.author_name="$!username";
 	comment.link_articleId=$article.id;
 	if($('#link_reply_comment_id').val()!=""){
 		comment.link_reply_comment_id=$('#link_reply_comment_id').val();
 		comment.link_reply_author_name=$('#link_reply_author_name').val();
 		}
 	/*登陆后才能评论
 	if(newpost.author_name=="anonymous"){
 		alert("登陆后再评论");
 		}
 	if(newpost.content!="" &&newpost.author_name!="anonymous"){*/
 	if(comment.content!=""){
 	$.ajax({
	  type: 'POST',
	  url: '/read/$article.id',
	  data: JSON.stringify(comment),
	  contentType : 'application/json',
	  dataType: "json",
	  success: function(data){//返回data类得到成员result
              alert(data.result); 
              //location.href = "/usercenter/index.html";       
              location.href = "/read/$article.id";
            }
		});
 	location.href = "/read/$article.id";
 	}else{
 	alert("输入不能为空");
 	}
  }


 
 	
 function canceled(){
 		 	$("#n1").show();
 	$("#n2").hide();
 	$("#link_reply_comment_id").val("");
			$("#link_reply_author_name").val("");
 		}
 		
 	function aaa(e){
			 	$("#n1").hide();
 	$("#n2").show();
 	//alert($(e));
 	//alert($(e).attr("author"));
 	$("#link_reply_comment_id").val($(e).attr("highid"));
			$("#link_reply_author_name").val($(e).attr("author"));
 		}	
 		

 	</script>